import sys
import requests
import time
import io

proxy=sys.argv[1]
url=sys.argv[2]


proxies={"http":"http://"+proxy}

print(proxies)
print(url)

headers={"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.75 Safari/537.36 Edg/86.0.622.38"}

t1 = time.time()
requests.adapters.DEFAULT_RETRIES = 5 # 增加重连次数

s= requests.session()
s.keep_alive = False # 关闭多余连接
s.headers=headers

s.proxies=proxies

try:
    response = s.get(url,headers=headers,proxies=proxies,timeout=5).text
except Exception as  e:
    print(e)

t2 = time.time()

print(response.encode('utf-8','ignore').decode('utf-8'))

